package com.gjx.clock.dao

import android.content.Context
import androidx.core.content.edit
import androidx.room.*
import com.gjx.clock.ClockApplication
import com.gjx.clock.entity.RestAlarmClock

@Dao
interface RestClockDao {

    @Insert
    fun insertClock(clock: RestAlarmClock): Long

    @Update
    fun updateClock(clock: RestAlarmClock)

    @Query("select * from RestAlarmClock")
    fun loadAllClocks(): List<RestAlarmClock>

    @Delete
    fun deleteClock(clock: RestAlarmClock)

    @Query("delete from RestAlarmClock where id = :id")
    fun deleteClockById(id: Long): Int


}